<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style type="text/css">
        #div1 {
            height: 100px;
            width: 300px;
            background-color: aquamarine;
        }
    </style>
</head>
<body>
<div id="div1">
    把鼠标移动到上面
</div>
<div style="margin-top:20px">
    <img src="img/1.jpg" id="jpg">
</div>
<div style="margin-top: 20px ;border: 1px solid black">
    <h3 id="h3">什么是受益人</h3>
    <p id="content"></p>
</div>
<div style="margin-top:20px ">
    <input type="checkbox" id="selectAll">全选/全不选
    <input type="checkbox" name="check">剑圣
    <input type="checkbox" name="check">vn
    <input type="checkbox" name="check">泰坦
</div>
<div style="margin-top:20px ">
    <h1 class="name" name="Name">张三</h1>
    <h1 class="name" name="Name">李四</h1>
    <h1 class="name" name="Name">王五</h1>
    <h1 class="name" name="Name">赵六</h1>
</div>
<div style="margin-top:20px ">
    <img src="img/bulb_off.png" id="light">
</div>
<script type="text/javascript" src="js1/jquery-1.11.1.js"></script>
<script type="text/javascript">
    $("div:first").mouseover(function () {
        $("div:first").html("谢谢")
    })
    $("div:first").mouseout(function () {
        $("div:first").html("把鼠标移动到上面")
    })

    $("img").click(function () {
        $(this).css("border","1px solid red")
    })

    $("h3").click(function () {
        $(this).css("background-color","aquamarine");
        $("p").html("解答︰受益人是指人身保险中由被保险人或者投保人指定的享有保险金请求权的人，投保人、被保险人可以为受益人。")
    })

   $(":checkbox:first").click(function () {
       $(":checkbox").prop("checked",$(this).prop("checked"))
   })
    var a =$(":checkbox:gt(0)")
    for (var c=0;c<a.length;c++){
        $(":checkbox:gt(0)").click(function () {
            if ($(":checkbox:eq(1)").prop("checked")==true&&$(":checkbox:eq(2)").prop("checked")==true&&$(":checkbox:eq(3)").prop("checked")==true){
                $(":checkbox:first").prop("checked",true);
            }else{
                $(":checkbox:first").prop("checked",false);
            }
        })
    }
    $("h1").click(function () {
        $(this).css("color","red")
    })

   $("img:last").mouseover(function () {
           $(this).prop("src","img/bulb_on.png")
       })
    $("img:last").mouseout(
        function () {
            $(this).prop("src","img/bulb_off.png")
        }
    )
    var b = "on"
    $("img:last").click(function () {
        if (b == "on") {
            b = "off"
        } else {
            b = "on"
        }
        $(this).prop("src","img/bulb_" + b + ".png")
    })
    // a.onmouseover = function () {
    //     a.src = "img/bulb_on.png"
    // }
    // a.onmouseout = function () {
    //     a.src = "img/bulb_off.png"
    // }
</script>
</body>
</html>